package com.IO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestOutAndIn {
    public static void main(String[] args) throws IOException {
        //确定数据源
        FileInputStream fis = new FileInputStream("E:\\Pictures\\kaisa.jpeg");
        //确定目的地
        FileOutputStream fos = new FileOutputStream("E:\\testFile\\kaisacopy.jpeg");

        //定义接受数组和返回值
        byte[] b = new byte[1024];
        int len;

        while((len=fis.read(b))!=-1){
            fos.write(b,0,len);
        }
        //关闭资源
        fos.close();
        fis.close();

    }
}

    